package com.best.oasis.settlement.service.security;

import java.util.List;

import com.best.oasis.settlement.common.entity.security.User;
import com.best.oasis.settlement.common.entity.security.UserGroupMapping;
import com.best.oasis.settlement.common.entity.security.UserRoleMapping;
import com.best.oasis.settlement.common.so.security.UserSO;
import com.best.oasis.settlement.common.vo.security.SelectedRoleGroupVO;
import com.best.oasis.settlement.common.vo.security.UserVO;
import com.best.oasis.settlement.service.base.BaseService;
import com.best.oasis.settlement.util.page.PageList;

public interface UserService extends BaseService<User, UserVO, Long> {
	/**
	 * 登录
	 * @param username
	 * @param password
	 * @return
	 */
//	public Principal login(String username, String password);
	/**
	 *新建用户信息
	 */
    public UserVO register(UserVO userVO);
	/**
	 *保存用户
	 */
    public UserVO save(UserVO userVO);
	/**
	 * 更新密码
	 */
    public boolean updatePassword(UserVO userVO, String oldPassword, String newPassword);   
	/**
	 * 用户管理模块中，用来记录当前用户被选中的用户组
	 *
	 */
    public List<SelectedRoleGroupVO> getSelectedRoleGroup(Long id);
	/**
	 *  从LdapServer获得用户信息
	 * @throws Exception 
	 *
	 */
    public UserVO getUserInfoFromLdapServer(String username) throws Exception;
	/**
	 *  获得当前登录用户信息
	 *
	 */
    public UserVO getLoginUser();
	/**
	 *  根据用户组获得用户信息
	 *
	 */
    public List<UserVO> getUsersByRoleGroupId(Long roleGroupId);
    
    public PageList<UserVO> getUserPageList(UserSO so);
    
    /**
	 * 根据groupId删除CRM_USER_ROLE的记录
	 * @param groupId
	 */
    public void removeUserRoleByRoleGroupId(Long groupId);
    /**
	 * 根据groupId删除CRM_USER_ROLEGROUP的记录
	 * @param groupId
	 */
    public void removeUserGroupByGroupId(Long groupId);
    
    /**
     * 新建User_Role
     */
    public void createUserRole(UserRoleMapping userRole) ;
    /**
     * 新建User_Group
     */
    public void createUserGroup(UserGroupMapping userGroup) ;
    
    public UserVO getUserByUsername(String username);
    
    public  UserVO simpleUpdate(UserVO userVO);
    /**
	 * 密码重置
	 */
    public UserVO resetPassword( UserVO user );
}
